package com.example.administrator.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

/**
 * Created by Administrator on 2020/11/19.
 */

public class ThreeActivity extends AppCompatActivity {

    private TextView usernameTv;
    private TextView scoreTv;
    private TextView ispassedTv;
    private String username;
    private int score;
    private Boolean ispassed;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_three);
        initView();
        initData();
        initEvent();
    }
    private void initView(){
        usernameTv = findViewById(R.id.username_tv);
        scoreTv = findViewById(R.id.score_tv);
        ispassedTv = findViewById(R.id.ispassed_tv);
    }
    private void  initData(){
//        Intent intent = getIntent();
        Bundle bundle = getIntent().getExtras();
        String username = bundle.getString("studentName");
       int  score =bundle.getInt("score");
        ispassed = bundle.getBoolean("ispassed");
//        username = intent.getStringExtra("studentName");
//        score = intent.getIntExtra("score",0);
//        ispassed = intent.getBooleanExtra("ispassed",true);
        usernameTv.setText(username+"");
        scoreTv.setText(score+"");
        ispassedTv.setText(ispassed+"");
    }
    private void initEvent(){

    }
}
